﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.Designer.Views
{
    public class SolutionViewModel
    {
        public static explicit operator SolutionViewModel(ServiceProxy.DesignServiceRef.Solution source)
        {
            SolutionViewModel dest = new SolutionViewModel();
            dest.ID = source.Id;
            dest.Name = source.Name;
            dest.Caption = source.Caption;
            dest.Version = source.Version;
            dest.RTVersion = source.RTVersion;
            dest.IsLocalExist = false;
            dest.Tag = source;
            dest.Type = source.Type;
            dest.UpdateTime = source.UpdateTime == DateTime.MinValue ? "" : source.UpdateTime.ToString("yyyy-MM-dd HH:mm:ss");
            dest.CreateTime = source.CreatedTime == DateTime.MinValue ? "" : source.CreatedTime.ToString("yyyy-MM-dd HH:mm:ss");
            return dest;
        }
        public Guid ID { get; set; }

        public string Name { get; set; }

        public string Caption { get; set; }

        public string Version { get; set; }

        public string RTVersion { get; set; }

        public bool IsLocalExist { get; set; }

        public bool IsLatest { get; set; }

        public bool IsSelected { get; set; }

        public object Tag { get; set; }

        public string Type { get; set; }

        public string CreateTime { get; set; }

        public string UpdateTime { get; set; }
    }
}
